<?php 
$_class=(isset($type)&&$type=='view') ? '' : ' class="link"';
echo '<div id="lnk-'.$link['Link']['id'].'"'.$_class.'>';
?>
  <div class="vote fl-59">
<?php 
$_span=$this->Html->link($link['Link']['votes']+$link['Link']['anonymous'],array('action'=>'view','slug'=>Inflector::slug($link['Link']['title']),$link['Link']['id'])).'<br />'.__('votes',true);

$_class='votes vote-shakeit';
if(!$link['isVotable']||($link['voteValue']<0)) $_class.=' closed';

echo $this->Html->div($_class,$_span,array('escape'=>false));


if(!$link['isVotable']){
	echo $this->Html->div('votelnk closed',__('votes closed',true));
}elseif($link['voteValue']<0){
	$negatives=Configure::read('Monky.negative');
	echo $this->Html->div('votelnk closed',$negatives[$link['voteValue']]);
}elseif($link['voteValue']>0){
	echo $this->Html->div('votes vote-shakeit voted',__('voted',true),array('escape'=>false));
}else { ?>
		<div class="shakeit votelnk">
	        <a class="thumb-up"></a> <a class="thumb-down"></a>
	        <div style="clear:both"></div>
	      </div>   
<?
}
?>
	</div>
 	<div class="link-info">
<? 
$iconstyle="float:right;height:20px;margin-left:-35px;position:relative;padding:3px;";
$icon=array('image'=>'icon/image.png','video'=>'icon/video.png');
$extra=false;

if($link['Link']['type']!='text') $extra=$this->Html->image($icon[$link['Link']['type']],array('style'=>$iconstyle,'alt'=>$link['Link']['type']));    

if($link['Link']['thumb']) { 
	$_thumb=$this->Html->link(
		$extra.$this->Html->image('link'.DS.$link['Link']['thumb'],array('alt'=>$link['Link']['title'])),$link['Link']['url'],array('rel'=>'nofollow,external','escape'=>false)
	);
} else{
	$_thumb=$extra;
}

if($_thumb) echo $this->Html->div('image-link', $_thumb,array('escape'=>false));		  	
?>
	      <h1>
	        <?=$this->Html->link($link['Link']['title'],$link['Link']['url'],array('rel'=>'nofollow,external','escape'=>'ISO-8859-1')) ?>
	      </h1>
	      <div class="author">
	        <strong><?=$this->Text->truncate($link['Link']['url'],70) ?></strong><br />
	        <?=__('by',true).' '.$this->Html->link($link['User']['login'],array('controller'=>'users','action'=>'view',$link['User']['id']),array('escape'=>'ISO-8859-1')).__('sended ').', '.$this->Time->timeAgoInWords($link['Link']['created']) ?>
	      </div>
	      <p style="overflow:hidden"><?=wordwrap($link['Link']['content'], 69, " ",true) ?></p>
	      <span><?
	      	$comments_count=$link['Link']['comment_count'];

	      	if($comments_count<10) {
		        $color='SeaGreen';
	        }elseif($comments_count<50) {
	        	$color='OrangeRed';
	        }else{
	        	$color='Red';
	        }
	      	
	      	$commentSpan=sprintf(__n('%d comments','No comments, be the first',$comments_count,true),$comments_count);
	        
	        echo  $this->Html->link($commentSpan,array('action'=>'view','slug'=>Inflector::slug($link['Link']['title']),$link['Link']['id'],'#'=>'comments'),array('style'=>'color:'.$color,'escape'=>'ISO-8859-1')).' | '.
	        __('in',true).' '.$this->Html->link($link['Category']['name'],array('action'=>'index','slug'=>Inflector::slug($link['Category']['name']),$link['Category']['id']),array('escape'=>'ISO-8859-1')).', '.$this->Html->link($link['Category']['Parent']['name'],array('action'=>'index','slug'=>Inflector::slug($link['Category']['Parent']['name']),$link['Category']['Parent']['id']),array('escape'=>'ISO-8859-1')).
	        ' | Karma: '.$link['Link']['karma'];
	      ?></span>
	    </div>
	  </div>
	  <div style="clear:both;"></div>